Skip to content

code refector by Muhammad Imran #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

manadinho
Copy link

No description provided.

'status'=>200,
'message'=>'Voting completed successfully'
'status' => $status,
'message' => $message
]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
]);
], $status);

return $this->response(200, 'Voting completed successfully');
}

public function response($status = 200, $message = '')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional parameters should be at the end. In this case 200 should be the default, so it would make more sense this way. And because the message should always be set you can remove the empty string as default :)

Suggested change
public function response($status = 200, $message = '')
public function response($message, $status = 200)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants